#include "uart_app.h"

uint8_t rx_dat[30];
uint8_t rx_finish_flag = 0;

void UART_proc(void)
{

    if(rx_finish_flag == 1)
    {
        if(mode == 1)
        {
            if(rx_dat[0] == '@')
            {
                show_mode = 0;
            }
            else if(rx_dat[0] == '#')
            {
                show_mode = 1;
            }
            else
            {
                printf("ERROR\n");
            }
        }
        else
        {
            printf("KEY CONTROL\n");
        }
        rx_finish_flag = 0;
    }
}


void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
{
    rx_finish_flag = 1;
}
